package com.jxw.launcher;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.squareup.picasso.Callback;
import com.squareup.picasso.Picasso;

/* loaded from: classes.dex */
public class ADActivity extends Activity {
    private int count = 6;
    private Handler mHandler = new Handler() { // from class: com.jxw.launcher.ADActivity.1
        @Override // android.os.Handler
        public void handleMessage(Message message) {
            ADActivity.access$010(ADActivity.this);
            if (ADActivity.this.count >= 0) {
                TextView textView = ADActivity.this.textView;
                ADActivity aDActivity = ADActivity.this;
                textView.setText(aDActivity.getString(R.string.tips_ad, new Object[]{ADActivity.this.count + ""}));
                sendEmptyMessageDelayed(0, 1000L);
                return;
            }
            ADActivity.this.finish();
        }
    };
    private TextView textView;

    static /* synthetic */ int access$010(ADActivity aDActivity) {
        int i = aDActivity.count;
        aDActivity.count = i - 1;
        return i;
    }

    @Override // android.app.Activity
    protected void onCreate(Bundle bundle) {
        super.onCreate(bundle);
        setContentView(R.layout.ad);
        this.textView = (TextView) findViewById(R.id.tips);
        this.textView.setOnClickListener(new View.OnClickListener() { // from class: com.jxw.launcher.ADActivity.2
            @Override // android.view.View.OnClickListener
            public void onClick(View view) {
                ADActivity.this.finish();
            }
        });
        Intent intent = getIntent();
        this.count = 6;
        Picasso.with(this).load(intent.getStringExtra("imgUrl")).into((ImageView) findViewById(R.id.image), new Callback() { // from class: com.jxw.launcher.ADActivity.3
            @Override // com.squareup.picasso.Callback
            public void onSuccess() {
                ADActivity.this.count = 6;
                ADActivity.this.mHandler.sendEmptyMessage(0);
            }

            @Override // com.squareup.picasso.Callback
            public void onError() {
                ADActivity.this.finish();
            }
        });
    }
}
